
#include "Timer.h"

std::string formatTime(int ticks)
{
	int hs = (int)(ticks / (CLOCKS_PER_SEC / 100.0));
	int s = ticks / CLOCKS_PER_SEC; 
	int ts = s % 60;
	int ths = hs % 100;
	int min = (int)s / 60;
	int tmin = min % 60;
	int h = min / 60;
	std::ostringstream stream;
	if(h > 0)
	{
		stream << h << " h";
	}
	if(tmin > 0)
	{
		if(h > 0)
		{
			stream << " "; 
		}
		stream << tmin << " min ";
	}
	stream << ts <<"," << ths << " sec";
	return stream.str();
}